package com.ruoyi.front.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.front.mapper.ServiceOrganizationApplyMapper;
import com.ruoyi.front.domain.ServiceOrganizationApply;
import com.ruoyi.front.service.IServiceOrganizationApplyService;
import com.ruoyi.common.core.text.Convert;

/**
 * 服务组织申请Service业务层处理
 * 
 * @author ruoyi
 * @date 2020-11-07
 */
@Service
public class ServiceOrganizationApplyServiceImpl implements IServiceOrganizationApplyService 
{
    @Autowired
    private ServiceOrganizationApplyMapper serviceOrganizationApplyMapper;

    /**
     * 查询服务组织申请
     * 
     * @param id 服务组织申请ID
     * @return 服务组织申请
     */
    @Override
    public ServiceOrganizationApply selectServiceOrganizationApplyById(Long id)
    {
        return serviceOrganizationApplyMapper.selectServiceOrganizationApplyById(id);
    }

    /**
     * 查询服务组织申请列表
     * 
     * @param serviceOrganizationApply 服务组织申请
     * @return 服务组织申请
     */
    @Override
    public List<ServiceOrganizationApply> selectServiceOrganizationApplyList(ServiceOrganizationApply serviceOrganizationApply)
    {
        return serviceOrganizationApplyMapper.selectServiceOrganizationApplyList(serviceOrganizationApply);
    }

    /**
     * 新增服务组织申请
     * 
     * @param serviceOrganizationApply 服务组织申请
     * @return 结果
     */
    @Override
    public int insertServiceOrganizationApply(ServiceOrganizationApply serviceOrganizationApply)
    {
        serviceOrganizationApply.setCreateTime(DateUtils.getNowDate());
        return serviceOrganizationApplyMapper.insertServiceOrganizationApply(serviceOrganizationApply);
    }

    /**
     * 修改服务组织申请
     * 
     * @param serviceOrganizationApply 服务组织申请
     * @return 结果
     */
    @Override
    public int updateServiceOrganizationApply(ServiceOrganizationApply serviceOrganizationApply)
    {
        serviceOrganizationApply.setUpdateTime(DateUtils.getNowDate());
        return serviceOrganizationApplyMapper.updateServiceOrganizationApply(serviceOrganizationApply);
    }

    /**
     * 删除服务组织申请对象
     * 
     * @param ids 需要删除的数据ID
     * @return 结果
     */
    @Override
    public int deleteServiceOrganizationApplyByIds(String ids)
    {
        return serviceOrganizationApplyMapper.deleteServiceOrganizationApplyByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除服务组织申请信息
     * 
     * @param id 服务组织申请ID
     * @return 结果
     */
    @Override
    public int deleteServiceOrganizationApplyById(Long id)
    {
        return serviceOrganizationApplyMapper.deleteServiceOrganizationApplyById(id);
    }
}
